package a.f.d.a;

import a.c.e;
import a.c.v;
import a.c.w;
import a.f.o;
import a.i.l;

import java.util.ArrayList;
import java.util.Comparator;

class ic
{
  private boolean a = false;
  private vc[] c = null;
  
  public void a(o paramo, ac paramac, bc parambc)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    if (!bool2) {
      if (!this.a) {
        return;
      }
    }
    int[] arrayOfInt = new int[paramo.j()];
    Comparator local0 = new Comparator()
    {
      private final int[] val$sid;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        return l.a(this.val$sid[((e)paramAnonymousObject1).f()], this.val$sid[((e)paramAnonymousObject2).f()]);
      }
    };
    Object localObject1 = paramo.v();
    Object localObject2;
    Object localObject3;
    label129:
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      e locale = ((w)localObject1).d();
      localObject2 = parambc.a(locale);
      localObject3 = ((ec)localObject2).n();
      if (!bool2)
      {
        if (localObject3 != null) {
          arrayOfInt[locale.f()] = ((vc)localObject3).j();
        }
      }
      else
      {
        if (bool2) {
          continue;
        }
        if (!bool1) {
          break label129;
        }
      }
      arrayOfInt[locale.f()] = -1;
      ((w)localObject1).f();
    } while (!bool1);
    localObject1 = null;
    int i = 0;
    label155:
    label292:
    label346:
    label347:
    do
    {
      if (i >= paramac.a()) {
        break;
      }
      localObject2 = paramac.a(i);
      do
      {
        localObject3 = ((vb)localObject2).c().g();
        Object localObject4 = null;
        for (v localv1 = ((vb)localObject2).c().f();; localv1 = localv1.a())
        {
          if (localv1 == localObject3) {
            break label292;
          }
          k = ((e)localv1.c()).f();
          int m = ((e)localv1.a().c()).f();
          if (bool2) {
            break label155;
          }
          if (bool1) {
            break;
          }
          if ((arrayOfInt[k] >= 0) && ((bool2) || (arrayOfInt[m] >= 0)) && (arrayOfInt[k] > arrayOfInt[m]))
          {
            localObject4 = localv1;
            break label292;
          }
        }
        if (localObject4 == null) {
          break label539;
        }
        int j = -1;
        if (!bool2) {
          if (localObject1 != null)
          {
            if (bool2) {
              break label347;
            }
            if (localObject1.length >= ((vb)localObject2).c().size()) {
              break label346;
            }
          }
        }
        localObject1 = new e[((vb)localObject2).c().size()];
        int k = 0;
        v localv2 = ((vb)localObject2).c().f();
        do
        {
          if (localv2 == null) {
            break;
          }
          int n = ((e)localv2.c()).f();
          int i1 = arrayOfInt[n];
          if (bool2) {
            break label468;
          }
          if (bool1) {
            break label466;
          }
          if (i1 < 0)
          {
            arrayOfInt[n] = j;
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            j = i1;
          }
          localObject1[k] = ((e)localv2.c());
          localv2 = localv2.a();
          k++;
        } while (!bool1);
        l.a((Object[])localObject1, 0, k, local0);
        if (!bool2) {
          k = 0;
        }
        localv2 = ((vb)localObject2).c().f();
        do
        {
          if (localv2 == null) {
            break;
          }
          localv2.a(localObject1[k]);
          localv2 = localv2.a();
          k++;
          if (bool2) {
            break label544;
          }
          if (bool1) {
            break label542;
          }
        } while (!bool1);
      } while (bool2);
      ((vb)localObject2).a(((vb)localObject2).c());
      i++;
    } while (!bool1);
    label466:
    label468:
    return;
  }
  
  public void c(o paramo, ac paramac, bc parambc)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    ArrayList localArrayList = new ArrayList();
    int i = 0;
    Object localObject1;
    Object localObject2;
    label139:
    label141:
    do
    {
      do
      {
        if (i >= paramac.a()) {
          break;
        }
        vb localvb = paramac.a(i);
        if (bool1) {
          return;
        }
        localObject1 = localvb.c().f();
        do
        {
          if (localObject1 == null) {
            break;
          }
          e locale = (e)((v)localObject1).c();
          localObject2 = parambc.a(locale);
          vc localvc = ((ec)localObject2).n();
          if (bool2) {
            break label141;
          }
          if (bool1) {
            break label139;
          }
          if (localvc != null) {
            localArrayList.add(localvc);
          }
          localObject1 = ((v)localObject1).a();
        } while (!bool1);
        if (!bool2) {
          i++;
        }
      } while (!bool1);
    } while (bool2);
    if ((bool2) || (localArrayList.size() > 0))
    {
      vc[] arrayOfvc = new vc[localArrayList.size()];
      this.a = true;
      l.a(localArrayList, null);
      int j = 0;
      localObject1 = (vc)localArrayList.get(0);
      arrayOfvc[j] = localObject1;
      ((vc)localObject1).a(j);
      int k = 1;
      if (k < localArrayList.size()) {}
      while (bool2)
      {
        localObject2 = (vc)localArrayList.get(k);
        if ((!bool2) && (bool1)) {
          break label316;
        }
        if (!bool2)
        {
          if (((vc)localObject2).compareTo(localObject1) > 0)
          {
            j++;
            arrayOfvc[j] = localObject2;
          }
          ((vc)localObject2).a(j);
          localObject1 = localObject2;
          k++;
        }
        if (!bool1) {
          break;
        }
      }
      this.c = new vc[j + 1];
      label316:
      System.arraycopy(arrayOfvc, 0, this.c, 0, this.c.length);
    }
  }
  
  vc a(int paramInt)
  {
    if ((this.c == null) || ((!d.R) && (paramInt < 0)) || (paramInt >= this.c.length)) {
      return null;
    }
    return this.c[paramInt];
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.ic

 * JD-Core Version:    0.7.0.1

 */